package com.android.wellcherish.workclock.bean.data;

import android.support.annotation.IntRange;
import java.util.Objects;

/**
 * @author 张文琛
 * @date 2020/3/19 22:17
 */
public abstract class IBaseBean {
    @IntRange(from = 0)
    private int id;

    public IBaseBean(int id) {
        this.id = id;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Override public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof IBaseBean)) return false;
        IBaseBean baseBean = (IBaseBean) o;
        return getId() == baseBean.getId();
    }

    @Override public int hashCode() {
        return Objects.hash(getId());
    }
}
